/**
 * 
 */
package com.sl;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lunshi
 * TODO
 * @创建时间 2020 2020年3月10日 下午12:35:24
 * @email:shilun217@qq.com
 */
@Configuration
@EnableConfigurationProperties(HelloWorldProperties.class)
public class HelloWorldAutoConfiguration{

	private final HelloWorldProperties helloWorldProperties;
	
	public HelloWorldAutoConfiguration(HelloWorldProperties helloWorldProperties) {
		this.helloWorldProperties=helloWorldProperties;
	}
	
	@Bean
	@ConditionalOnMissingBean
	public HelloWorldService helloWorldService(){
		return new DefaultHelloWorldService(this.helloWorldProperties);
	}
}
